$(document).ready(function(){
    $("#upvote-article").click(function(){
        var article_id = $('#article_id').attr("value"); 
        var upvote_total=$.ajax({url:"https://www.fxpixels.site/lv5/public/index.php/article/" + article_id + "/upvote", async:false});
        $("#upvote_total").text(upvote_total.responseText);
    });

    $("#upvote-paper").click(function(){
        var article_id = $('#article_id').attr("value"); 
        var upvote_total=$.ajax({url:"https://www.fxpixels.site/lv5/public/index.php/paper/" + article_id + "/upvote", async:false});
        $("#upvote_total").text(upvote_total.responseText);
    });


    // $('#content').html($('#content').text());
    
    $('#content').html($('#content').text().replace('<br>', '<br>'));

    function reply(a) {
        var nickname = a.parentNode.parentNode.firstChild.nextSibling.getAttribute('data');
        var textArea = document.getElementById('newFormContent');
        textArea.innerHTML = '@' + nickname + ' ';
      }
});